<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/vue.js"></script>
</head>
<body>
    <div id="app">
        
         请你输入喜欢的游戏名字,按回车打印出来<input type="text" v-model="game" @keyup.enter="handle">
    </div>
</body>
</html>
<script>
    
     const VM  = new Vue({
          el:'#app',
        
          data:{
              game:''
          },
          
          methods: {
              handle(e){
                 
                  console.log('我喜欢的游戏是'+e.keyCode);
                 
              }
          }
     })
</script>